package com.hama.zea.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Random;

/**
 * 生成word-seed格式文件
 */
public class CreateSeedFile {


    public static void main(String[] args) {

        Random random=new Random();
        zx(random);
    }


    public static String returnWord(Random random, int seed){
        random.setSeed(seed);
        StringBuilder sb = new StringBuilder();
        while (true){
            int k=random.nextInt(27);
            //System.out.println("char:" + k + ",number:" +  k);
            if(k==0)

                break;
            k+=96;
            sb.append((char)k);
        }
        return sb.toString();
    }


    public static void zx(Random random) {

        BufferedReader br;
        try {
            String pathAndName="J://seedword//seedword.txt";
            StringBuilder sb = new StringBuilder();
            int min=-2147483648;
            int middle=0;
            int max=2147483647;
            for (int i = min; i < min+10; i++) {
                random.setSeed(i);
                while (true){
                    int k=random.nextInt(27);
                    //System.out.println("char:" + k + ",number:" +  k);
                    if(k==0)
                        break;
                    k+=96;
                    sb.append((char)k);
                }
                FileToolkit.string2File(i+":"+sb.toString()+";",pathAndName);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void print(Object str){
        System.out.println(str);
    }





}
